/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package regras;

import Interfaces.CheckerRule;

/**
 *
 * @author Tainá, Ana Luiza e Amanda
 */
public class RuleUpperLetter02 implements CheckerRule{
    private String password;
    public RuleUpperLetter02(String password) {
        this.password = password;
    }
    
    @Override
    public int rule(){
        int total = 0;
        String senha = " "+password+" ";
        int alphaUC = senha.split("([A-Z])").length - 1;
        if (alphaUC>0 && alphaUC < password.length()){ 
           total +=(password.length() - alphaUC) * 2; 
        }
        return total;
    }    
}
